<?php
/**i
 * Created by PhpStorm.
 * User: lihao
 * Date: 2017/7/20
 * Time: 下午12:11
 */

class Home extends MY_Controller {

    public function __construct() {
        parent::__construct();
        $this->load->model('Photo_model');
        $this->load->model('Project_model');
        $this->load->model('User_model');
    }


    public function index()
    {
        $pro = $this->Project_model->getlist(null, 3, 0);
        $re = $this->Photo_model->getDirsWithCover();
        $users = $this->User_model->search(null, null, 5, 0);
        $this->load->view('index', array(
            'dirs'=>$re,
            'projects'=>$pro,
            'users'=>$users
        ));
//        $str = $this->load->view('index', array(
//            'dirs'=>$re,
//            'projects'=>$pro,
//            'users'=>$users
//        ), TRUE);
//
//
//        $etag = 'W/'.md5($str);
//        header("ETag:$etag");
//
//        if (@trim($_SERVER['HTTP_IF_NONE_MATCH']) == $etag) {
//            header("HTTP/1.1 304 Not Modified");
//            exit;
//        }
//        echo $str;
    }

}